<?php

namespace App\Console;

use App\Http\Controllers\Live\ActivityController;
use App\Jobs\PullLiveRoomOnlineStatusListJob;
use App\Jobs\RunRedisListCheckJob;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')->hourly();
        $schedule->job(new RunRedisListCheckJob([
            "time"=>time(),
            "flag"=>'clearing_send_points',
            "cache_key_activity_list"=>ActivityController::REDIS_PREFIX_GROUP_POINTS."activity_list",
        ]), 'after_points_send_job')->cron('* * * * *');
        //$schedule->job(new PullLiveRoomOnlineStatusListJob(),"pull_liveroom_online_status")->cron('* * * * *');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
